﻿var ValidateType = { 
        text:[
            ['不需要', ''],
            ['非空', 'require'],
            ['数值比较', 'compare'],
            ['内容匹配', 'match'],
            ['正则式', 'custom']
        ],
        textarea: [
            ['不需要', ''],
            ['非空', 'require'],
            ['数值比较', 'compare'],
            ['内容匹配', 'match'],
            ['正则式', 'custom']
        ],
        DropDownList: [
            ['不需要', ''],
            ['非空', 'require']
        ],
        CheckBoxList: [
            ['不需要', ''],
            ['必选', 'group']
        ],
        RadioButtonList: [
            ['不需要', ''],
            ['必选', 'group']
        ],
        Date: [
            ['不需要', ''],
            ['日期验证', 'date']
        ],
        File:[],
        Html: [],
        Hidden: [
            ['不需要', ''],
            ['非空', 'require'],
            ['数值比较', 'compare'],
            ['内容匹配', 'match'],
            ['正则式', 'custom']
        ]
    },

    ValidateOperator = {
        '': [],
        require: [],
        compare: [
            ['等于', 'Equal'],
            ['不等于', 'NotEqual'],
            ['大于', 'GreaterThan'],
            ['大于等于', 'GreaterThanEqual'],
            ['小于', 'LessThan'],
            ['小于等于', 'LessThanEqual']
        ],
        match: [
            ['包含', 'contain'],
            ['不包含', 'notcontain'],
            ['匹配开头', 'beginwith'],
            ['不匹配开头', 'notbeginwith'],
            ['匹配结尾', 'endwith'],
            ['不匹配结尾', 'notendwith']
        ],
        custom: [
            ['匹配', 'match']
        ],
        group: [],
        date:[]
    },

    ItemDataType = {
        text: [
            ['字符串', 'String'],
            ['数字', 'Decimal']
        ],
        textarea: [
            ['文本', 'Text']
        ],
        DropDownList: [
            ['字符串', 'String']
        ],
        CheckBoxList: [
            ['字符串', 'String']
        ],
        RadioButtonList: [
            ['字符串', 'String']
        ],
        Date: [
            ['字符串', 'String']
        ],
        File: [
            ['文件', 'File']
        ],
        Html: [
            ['文本', 'Text']
        ],
        Hidden: [
            ['字符串', 'String']
        ]
    };

function checkName(name) {
    var reg = new RegExp("name=\"bwdf_[a-z]{3}_" + name + "\"");
    if (reg.test(CKEDITOR.instances.WorkFlowFormEditor.getData())) {
        return false;
    }
    return true;
}
